Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scatter plot #37

Closed
wants to merge 3 commits into from
Closed

Add scatter plot #37

wants to merge 3 commits into from

Conversation

Pepe-Marquez
Copy link
Contributor

@Pepe-Marquez Pepe-Marquez commented Nov 21, 2024

Summary by Sourcery

Add a scatter plot feature to the perovskite ions app and enhance the documentation with new guides and acknowledgments. Refactor widget layout configuration for better readability and update tests to accommodate changes.

New Features:

  • Introduce a scatter plot feature in the perovskite ions app, allowing visualization of data with customizable axes and markers.

Enhancements:

  • Refactor the layout configuration for widgets in the perovskite ions app to improve readability and maintainability.

Documentation:

  • Update the documentation to include new sections on creating perovskite compositions, adding new ions, exporting cation structures, and searching for ions.
  • Add badges and acknowledgments to the documentation, enhancing its presentation and providing credit to contributors.

Tests:

  • Modify the test for importing the solar cell app to ignore type checking, ensuring compatibility with the updated code.

Copy link

sourcery-ai bot commented Nov 21, 2024

Reviewer's Guide by Sourcery

This PR adds a scatter plot widget to the perovskite ions app and reorganizes the documentation structure. The scatter plot visualizes the relationship between A cation molar mass and number of atoms, with structural type as a color marker. The documentation changes include improved organization, new how-to guides, and additional resources.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added a new scatter plot widget to visualize perovskite ion relationships
  • Implemented scatter plot with A cation molar mass vs number of atoms
  • Added color coding based on structural type
  • Configured responsive layout settings for different screen sizes
src/perovskite_solar_cell_database/apps/perovskite_ions_app.py
Restructured and enhanced documentation
  • Added new how-to guides for ion-related operations
  • Reorganized navigation structure
  • Added EU funding and project logos
  • Updated installation instructions
  • Improved homepage content organization
docs/index.md
mkdocs.yml
docs/how_to/install_this_plugin.md
docs/how_to/create_a_perovskite_composition.md
docs/how_to/add_a_new_ion.md
docs/how_to/export_a_cation_structure.md
docs/how_to/search_for_ions.md
docs/tutorial/sharing_a_perovskite_composition.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Pepe-Marquez - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

h: 6
w: 9
y: 0
x: .inf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Invalid x coordinate value '.inf' in xxl layout

The x coordinate value '.inf' is invalid and could cause rendering issues. Please specify a valid numeric value.

Comment on lines +3 to 4
from perovskite_solar_cell_database.apps.solar_cell_app import ( # type: ignore
solar_cell_app, # noqa: F401
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (testing): Missing tests for the new scatter plot functionality

The PR adds a new scatter plot widget but there are no tests to verify its configuration and behavior. Consider adding tests that verify:

  1. The scatter plot widget is properly configured with the correct search quantities
  2. The layout parameters are correct for different screen sizes
  3. The autorange and marker settings work as expected


[<img src="assets/screenshot_nomad_app.png">](https://nomad-lab.eu/prod/v1/staging/gui/search/solarcells)
It also contains a database of ions used in halide perovskites and a schema to create standarized perovskite composition entries.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Fix typo: 'standarized' should be 'standardized'

Suggested change
It also contains a database of ions used in halide perovskites and a schema to create standarized perovskite composition entries.
It also contains a database of ions used in halide perovskites and a schema to create standardized perovskite composition entries.


### Acknowledgments
Special thanks to Jinzhao Li and all contributors who have made this project possible.
This project is supported by the FAIRmat NFDI initiative and also by by the European Union as part of the SolMates project (Project Nr. 101122288).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Remove duplicate word 'by'

The sentence contains a duplicate 'by'. Consider revising to 'supported by the FAIRmat NFDI initiative and also by the European Union'

Suggested change
This project is supported by the FAIRmat NFDI initiative and also by by the European Union as part of the SolMates project (Project Nr. 101122288).
This project is supported by the FAIRmat NFDI initiative and also by the European Union as part of the SolMates project (Project Nr. 101122288).

md: {minH: 8, minW: 12, h: 8, w: 12, y: 0, x: 0}
sm: {minH: 8, minW: 12, h: 8, w: 12, y: 0, x: 0}
type: periodictable
- type: periodictable
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (complexity): Consider using YAML anchors and aliases to define reusable layout configurations.

The layout configuration can be simplified using YAML anchors and aliases to reduce repetition while maintaining the same functionality. Here's how:

widgets:
  - type: periodictable
    scale: linear
    search_quantity: results.material.elements
    layout:
      # Define base layout template
      &base_layout
      minH: 8
      minW: 12
      y: 0
      x: 0

      xxl:
        <<: *base_layout
        h: 9
        w: 13
      xl:
        <<: *base_layout
        h: 9
        w: 12
      lg: &standard_size
        <<: *base_layout
        h: 8
        w: 12
      md:
        <<: *standard_size
      sm:
        <<: *standard_size

This approach:

  • Defines common properties once using &base_layout
  • Uses <<: *base_layout to inherit common properties
  • Only specifies values that differ for each screen size
  • Further reduces duplication by reusing identical sizes with &standard_size

The same pattern can be applied to the scatter_plot widget's layout.

@Pepe-Marquez Pepe-Marquez deleted the add-scatter-plot branch November 21, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant